package com.enjoyor.soa.traffic.server.efoms.dubbo.manage;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.dubbo.config.annotation.Service;
import com.enjoyor.soa.traffic.api.dto.efoms.VideoGroupInfoDto;
import com.enjoyor.soa.traffic.api.dto.efoms.VideoRelationInfoDto;
import com.enjoyor.soa.traffic.core.efoms.domain.VideoGroupInfo;
import com.enjoyor.soa.traffic.core.efoms.service.IVideoGroupInfoService;
import com.enjoyor.soa.traffic.util.helper.ReflectHelper;
import com.enjoyor.soa.traffic.util.helper.ResultHelper;
import com.enjoyor.soa.traffic.util.pojo.Page;
import com.enjoyor.soa.traffic.util.pojo.ResultPojo;

@Service(timeout = 6000)
public class ManageVideoGroupInfoService {
	
	@Autowired
	private IVideoGroupInfoService videoGroupInfoService;

	public ResultPojo getVideoGroupInfo(String videoGroupId) {
		VideoGroupInfo videoGroupInfo = videoGroupInfoService.getVideoGroupInfo(videoGroupId);
		return ResultHelper.getResult(ReflectHelper.beanToBean(videoGroupInfo, VideoGroupInfoDto.class));
	}

	public ResultPojo getVideoGroupInfoPage(String videoGroupId, String parentCode,String key,String devAreaCode,Page page) {
		return ResultHelper.getResult(videoGroupInfoService.getVideoGroupInfoPage(videoGroupId, parentCode,key,devAreaCode,page));
	}

	public ResultPojo getVideoGroupInfoList(String videoGroupId, String parentCode,String key,String devAreaCode) {
		List<VideoGroupInfo> list = videoGroupInfoService.getVideoGroupInfoList(videoGroupId, parentCode,key,devAreaCode);
		return ResultHelper.getResult(ReflectHelper.listToList(list, VideoGroupInfoDto.class));
	}

	public ResultPojo insertVideoGroupInfo(VideoGroupInfoDto videoGroupInfoDto, String userName) {
		VideoGroupInfo videoGroupInfo = ReflectHelper.beanToBean(videoGroupInfoDto,VideoGroupInfo.class);
		return videoGroupInfoService.insertVideoGroupInfo(videoGroupInfo, userName);
	}

	public ResultPojo updateVideoGroupInfo(VideoGroupInfoDto videoGroupInfoDto, String userName) {
		VideoGroupInfo videoGroupInfo = ReflectHelper.beanToBean(videoGroupInfoDto,VideoGroupInfo.class);
		return videoGroupInfoService.updateVideoGroupInfo(videoGroupInfo, userName);
	}

	public ResultPojo deleteVideoGroupInfo(String videoGroupId, String userName) {
		return videoGroupInfoService.deleteVideoGroupInfo(videoGroupId, userName);
	}

}
